<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <h3>数据监听</h3>
        <p>数量:{{counter}}</p>
        <p>单价:{{price}}</p>
        <button @click="counter++">点击</button>
    </div>
<script src="../js/vue.js"></script>
<script src="./js/listen.js"></script>


<!-- 
<script>
    const app = new Vue({
            el: "#app",
            data: {
                counter: 1,
                price: 1
            },
            watch: {
                counter: function (val) {
                    this.price = this.counter * 100
                },
            }
        })
</script> -->
</body>
</html>